// pages/payMethod/payMethod.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    payList: [
      {
        type: 1,
        name: '支付宝'
      },
      {
        type: 2,
        name: '微信'
      },
      {
        type: 3,
        name: '银行卡'
      }
    ]
  },

  back: function(e) {
    const {detail:{name, type}} = e
    const pages = getCurrentPages()
    const prevPage = pages[pages.length - 2]

    prevPage.setData({
      type: type,
      payName: name
    },() => {
      wx.navigateBack()
    })
  }
})